import pygame
from pygame.locals import *
pygame.mixer.init()
pygame.mixer.music.load('bg_music.ogg')
pygame.mixer.music.set_volume(0.2)
pygame.mixer.music.play()
# 加载音效
loser_sound = pygame.mixer.Sound('loser.wav')
laugh_sound = pygame.mixer.Sound('laugh.wav')
winner_sound = pygame.mixer.Sound('winner.wav')
hole_sound = pygame.mixer.Sound('hole.wav')

gary_ball_image = 'gray_ball.png'
green_ball_image = 'green_ball.png'
bg_image = 'background.png'
glass_image = 'glass.png'
mouse_image = 'hand.png'

bg_size = width, height = 1024, 681

# 打印的消息列表
msgs = []
# 存放小球的列表
balls = []
group = pygame.sprite.Group()

clock = pygame.time.Clock()
GAMEOVER = USEREVENT
pygame.mixer.music.set_endevent(GAMEOVER)

MYTIMER = USEREVENT + 1
pygame.time.set_timer(MYTIMER, 1000)

hole = [(117, 119, 199, 201), (225, 227, 390, 392), (503, 505, 320, 322),
            (698, 700, 192, 194), (906, 908, 419, 421)]